<?php 
        //云标签
        $tagModel = new \Common\Model\Tag;
		$arcTagModel = new \Common\Model\ArcTag;
		$tagData = $tagModel->get();
		foreach ($tagData as $k=>$v) {
			$tagData[$k]['total']= $arcTagModel->where("tag_tid={$v['tid']}")->count();
		}
		//友情链接
       $LinkModel = new \Common\Model\Link;
         //获得所有的链接数据,多条数据用get,一条数据用find();
	    $LinkData = $LinkModel->get();
		//最新文章
	    //引入分类控制器
    	$cateModel = new \Common\Model\Cate;
		//首页文章
		$arcModel = new \Common\Model\Arc;
		//将文章表和标签表关联
		$data = $arcModel
		    //field 可以直接提取需要的字段
		      ->field('title,sendtime')
			  //按照加入时间的降序排列,可以得到最新文章
			  
			  ->orderBy('sendtime','DESC')
			  
			  
			  ->limit(3)
			  ->get();
			 
			  	
			  






 ?>
<html>
	<head>
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="Public/Home/org/bootstrap-3.3.5-dist/css/bootstrap.min.css" />
		<script src="Public/Home/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="Public/Home/org/bootstrap-3.3.5-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="Public/Home/css/index.css" />
		<link rel="stylesheet" type="text/css" href="Public/Home/css/backTop.css"/>
	</head>
	<body>
		<footer class="hidden-xs">
			<div class="container">
				<div class="row">
					<div class="col-sm-4">
						<h4 class="_title">最新文章</h4>
						<?php foreach ($data as $v){?>
						<div id="" class="_single">
							
							<p><a href=""><?php echo $v['title']?></a></p>
							<time><?php echo date('Y-m-d',$v['sendtime'])?></time>
						</div>
						<?php }?>	
					</div>
					<div class="col-sm-4 footer_tag" style="width: 550px;">
						<div id="" style="float: left;">
							<h4 class="_title">标签云</h4>
							<div class="_tag">
					        <?php foreach ($tagData as $value){?>
						        <a href="<?php echo U('List/index',array('tid'=>$value['tid']))?>"><?php echo $value['tname']?><?php echo $value['total']?></a>
					        <?php }?>
						</div>
					</div>
					<div class="col-sm-4" style="float: right;width: 230px;">
						<h4 class="_title">友情链接</h4>
						<div id="" class="_single">
							<?php foreach ( $LinkData as $v){?>
                               <a style="float: left;" href="<?php echo $v['url']?>"><?php echo $v['lname']?></a>
									
				
			                <?php }?>
						</div>
					</div>
				</div>
			</div>
		</footer>
		<div class="footer_bottom">
			<div class="container">
				<div class="row">
					<div class="col-sm-12">
						<a href=""><?php echo C('webset.WEB_NAME')?></a>
						 | 
						<a href=""><?php echo C('webset.COPY_RIGHT')?></a>
						 |
						<a href=""><?php echo C('webset.ADMIN_EMAIL')?></a>
						|
						<a href=""><?php echo C('webset.LICENSE')?></a>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>